From: Michael Catanzaro Date: Tue, 20 Dec 2016 20:00:42 +0000 (-0600) Subject: network: Avoid JS error when activating VPN connection X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~602 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=da7db509e7546324152e8af558fb44c587fa0aae;p=gnome-shell.git network: Avoid JS error when activating VPN connection If the call to settings.get_connection_by_path in ensureActiveConnectionProps returns null, we'll hit a JS error here. Seems to happen always when activating a VPN connection. Avoid that. Giovanni says: "I believe this is papering over an existing bug, but it's possible for settings.get_connection_by_path() to legitimately return null (if the connection is owned by a different user and invisible to the current one), so the fix is correct anyway." https://bugzilla.gnome.org/show_bug.cgi?id=759793 --- diff --git a/js/ui/status/network.js b/js/ui/status/network.js index 2c6d9d899..835c315f6 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -1543,8 +1543,10 @@ const NMVPNSection = new Lang.Class({ item.setActiveConnection(null); } vpnConnections.forEach(Lang.bind(this, function(a) { - let item = this._connectionItems.get(a._connection.get_uuid()); - item.setActiveConnection(a); + if (a._connection) { + let item = this._connectionItems.get(a._connection.get_uuid()); + item.setActiveConnection(a); + } })); },